<template>
  <div class="container">
    <FmTable ref="fmTable" url="/process/flowable" id="taskId" tableName="task" listapiurl="todoList" :columns="columns"
             :toolbar="['del']">
      <template #procDefVersion="scope">
        <el-tag size="small">v{{ scope.row.procDefVersion }}</el-tag>
      </template>

      <template #opt="scope">
        <el-button
            size="small"
            type="primary"
            link
            icon="Pointer"
            @click="handleProcess(scope.row)"
        >处理
        </el-button>
      </template>
    </FmTable>

  </div>
</template>

<script setup lang="ts">
import {useRouter} from "vue-router";
let router=useRouter()
const handleProcess = (row) => {
  router.push({
    path: '/admin/task/todoprocessdeatil',
    query: {
      procInsId: row.procInsId,
      executionId: row.executionId,
      deployId: row.deployId,
      taskId: row.taskId,
      taskName: row.taskName,
      startUser: row.startUserName + '-' + row.startDeptName,
    }
  })
}
const columns = [
  {
    "label": "任务编号",//标签名称
    "index": "taskId",//数据库索引
    "rules": [
      {required: true, message: "请输入主键", trigger: "blur",},
    ],//值规则
    "search": true,//是否是搜索表单
    "dataType": "text",//值值类型默认字符类型
    "addable": false
  },
  {
    "label": "流程名称",//标签名称
    "index": "procDefName",//数据库索引
    "rules": [
      {required: true, message: "请输入主键", trigger: "blur",},
    ],//值规则
    "search": true,//是否是搜索表单
    "dataType": "text",//值值类型默认字符类型
    "addable": false
  },
  {
    "label": "当前节点",//标签名称
    "index": "taskName",//数据库索引
    "rules": [
      {required: true, message: "请输入主键", trigger: "blur",},
    ],//值规则
    "dataType": "text",//值值类型默认字符类型
    "addable": false
  },
  {
    "label": "流程版本",//标签名称
    "index": "procDefVersion",//数据库索引
    "rules": [
      {required: true, message: "请输入主键", trigger: "blur",},
    ],//值规则
    "dataType": "text",//值值类型默认字符类型
    "addable": false
  },
  {
    "label": "提交时间",//标签名称
    "index": "createTime",//数据库索引
    "rules": [
      {required: true, message: "请输入主键", trigger: "blur",},
    ],//值规则
    "dataType": "text",//值值类型默认字符类型
    "addable": false
  },
  {
    "label": "流程状态",//标签名称
    "index": "finishTime",//数据库索引
    "rules": [
      {required: true, message: "请输入主键", trigger: "blur",},
    ],//值规则
    "dataType": "text",//值值类型默认字符类型
    "addable": false
  },
  {
    "label": "耗时",//标签名称
    "index": "duration",//数据库索引
    "rules": [
      {required: true, message: "请输入主键", trigger: "blur",},
    ],//值规则
    "dataType": "text",//值值类型默认字符类型
    "addable": false
  },
  {
    "label": "当前节点",//标签名称
    "index": "taskName",//数据库索引
    "rules": [
      {required: true, message: "请输入主键", trigger: "blur",},
    ],//值规则
    "dataType": "text",//值值类型默认字符类型
    "addable": false
  },
  {
    "label": "办理人",//标签名称
    "index": "assigneeName",//数据库索引
    "rules": [
      {required: true, message: "请输入主键", trigger: "blur",},
    ],//值规则
    "dataType": "text",//值值类型默认字符类型
    "addable": false
  },
  {
    "type": "opt",//普通行，字典行，自定义行
    "label": "操作",//标签名称
    "index": "opt",//数据库索引
    "rules": [],//值规则
    "width": 150,
    "dataType": "text",//值值类型默认字符类型
  }
]

</script>

